<?php

namespace sil29\VitrineBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UserType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nom','text', array( 'attr' => array('placeholder' =>'Nom')))
            ->add('prenom','text',array( 'attr' => array('placeholder' =>'Prenom')))
            ->add('dateDeNaissance','date')
            ->add('adresse','text',array( 'attr' => array('placeholder' =>'Adresse')))
            ->add('codePostal','text',array( 'attr' => array('placeholder' =>'00000')))
            ->add('ville','text',array( 'attr' => array('placeholder' =>'Ville')))
            ->add('login','text',array( 'attr' => array('placeholder' =>'Login')))
            ->add('motDePasse','password')
            ->add('email','email',array( 'attr' => array('placeholder' =>'email@domain.com')))
            ->add('submit','button')
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'sil29\VitrineBundle\Entity\User'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'sil29_vitrinebundle_user';
    }
}
